package com.placement.refresh.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import com.placement.refresh.dao.RefreshDAO;
import com.placement.refresh.exception.RefreshRuntimeException;
import com.placement.refresh.model.RefreshContextBVO;
import com.placement.refresh.interceptor.BeanFactoryProxy;

/**
 * purpose: This class maintain cache for frequently used variables.
 * 
 * @author Amit Chadha
 *
 */
public class Lookup {

	private static final Log LOG = LogFactory.getLog(Lookup.class);
	
	
	private static RefreshContextBVO currBatchRunContext=null;
	private static RefreshContextBVO lastBatchRunContext=null;
	
	
	
	
	/**
	 * purpose: This method retrives Current Batch run Context details and maintain cache.
	 * 
	 * @return	:RefreshContextBVO
	 */
	public static RefreshContextBVO getCurrBatchRunContext(){
		if(currBatchRunContext==null){
			RefreshDAO refreshDAO = (RefreshDAO)BeanFactoryProxy.getBean("refreshDAO");
			currBatchRunContext = refreshDAO.getCurrBatchRunContext();
		}
		return currBatchRunContext;
		
	}


	
	
	
}